/**
 * @file		assignBikes.cpp
 * @description		This demonstrates creating a user defined type, 
 *			Bike. Notice that the class can be used by other
 *			programmers, thus, the class is documented with
 *			doxygen comments. All of the public functions and
 *			members need to be documented because, again, they
 *			are accessible to others. Therefore, they must be 
 *			properly documented to explain to others how they are
 *			used. I have left out the @pre and @post annotations
 *			for the functions, but you need to included them.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <string>
using namespace std;

/**
 * This is the bike class. The public members and functions
 * are accessible to every. The private members and functions
 * are only accessible to the class. This example doesn't use
 * a constructor to create the Bike Object. In this case, C++
 * will provide one for us that does NOTHING.
 */
class Bike {
public:
	/**
	 * Gets the bike's name.
	 * @return the name of the bike
	 */
	string getName();
	
	/**
	 * Set the bike's name.
	 * @param aName the name to set the bike's name to.
	 */
	void setName(string aName);
	
	/**
	 * Gets the bike's name.
	 * @return the name of the bike
	 */
	int getSize();
	
	/**
	 * Set the bike's frame size.
	 * @param aSize the size to set the bike's frame to.
	 */
	void setSize(int aSize);
	
	/**
	 * Gets the bike's name.
	 * @return the name of the bike
	 */
	double getWheelDiameter();
	
	/**
	 * Set the bike's wheel diameter
	 * @param aDiameter the diameter to set the bike's diameter to.
	 */
	void setWheelDiameter(double aDiameter);

private:
	// this is a private function, only this class can access
	// a private function. Private functions are usually utility
	// functions for the class. They won't be accessed by others
	// therefore the documentation can be left out. We only want to
	// explain the api that others can use.
	bool validSize(int aSize);
	string mName;
	int mSize;
	double mWheelDiameter;
};

/**
 * @return zero if the application executes successfully
 */
int main() {

	Bike mtnBike;
	mtnBike.setName("Foes");		// users have to use accessors
	mtnBike.setSize(18);			// and mutators to get to the 
	mtnBike.setWheelDiameter(26.0);		// private data in the object

	Bike mtnBike2 = mtnBike;		// the assignment operator copies
						// all the members in one object to
						// another

	cout << "Mountain Bike " << mtnBike2.getName() << endl;
	cout << "has a frame size of " << mtnBike2.getSize() << endl;
	cout << "and a wheel diameter of " << mtnBike2.getWheelDiameter() << endl;

	return 0;
}

string Bike::getName() {
	return mName;
}

void Bike::setName(string aName) {
	mName = aName;
}

int Bike::getSize() {
	return mSize;
}

void Bike::setSize(int aSize) {
	if(validSize(aSize))
		mSize = aSize;
	else
		mSize = 10;
}

double Bike::getWheelDiameter() {
	return mWheelDiameter;
}

void Bike::setWheelDiameter(double aDiameter) {
	mWheelDiameter = aDiameter;
}

bool Bike::validSize(int aSize) {
	if(aSize <= 0)
		return false;
	return true;
}

